﻿﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Serialization;
using Fcdbas.Core;
using Fcdbas.Core.Configuration;
using Fcdbas.Core.DataAccess;


namespace Fcdbas.Biz
{
    /// <summary></summary>
    [Serializable]
    [DataObject]
    [Description("")]
    [BindTable("fnd_enumerate_tab", Description = "", ConnName = "", DbType = DatabaseType.MySql)]
    public class fnd_enumerate : Entity<fnd_enumerate>,Ifnd_enumerate
    {
        #region 属性
 
        private String _lu_name;

        /// <summary>FLAGS=KMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Lu Name^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=False^ARG=^</summary>
        [DisplayName("Lu Name")]
        [Description("FLAGS=KMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Lu Name^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=False^ARG=^")]
        [DataObjectField(false, false, false, 35)]
        [BindColumn(1, "lu_name",  null, "varchar(35)", 0, 0, false)]

        public virtual String lu_name

        {
            get { return _lu_name; }
            set { if (OnPropertyChanging(__.lu_name, value)) { _lu_name = value; OnPropertyChanged(__.lu_name); } }
        }

 
        private String _db_value;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Db Value^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
        [DisplayName("Db Value")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Db Value^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^")]
        [DataObjectField(false, false, false, 2000)]
        [BindColumn(2, "db_value",  null, "varchar(2000)", 0, 0, false)]

        public virtual String db_value

        {
            get { return _db_value; }
            set { if (OnPropertyChanging(__.db_value, value)) { _db_value = value; OnPropertyChanged(__.db_value); } }
        }

 
        private String _client_value;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=显示值^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
        [DisplayName("显示值")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=显示值^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^")]
        [DataObjectField(false, false, false, 2000)]
        [BindColumn(3, "client_value",  null, "varchar(2000)", 0, 0, false)]

        public virtual String client_value

        {
            get { return _client_value; }
            set { if (OnPropertyChanging(__.client_value, value)) { _client_value = value; OnPropertyChanged(__.client_value); } }
        }

 
        private String _module;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Module^LENGTH=15^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
        [DisplayName("Module")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Module^LENGTH=15^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^")]
        [DataObjectField(false, false, false, 15)]
        [BindColumn(4, "module",  null, "varchar(15)", 0, 0, false)]

        public virtual String module

        {
            get { return _module; }
            set { if (OnPropertyChanging(__.module, value)) { _module = value; OnPropertyChanged(__.module); } }
        }

 
        private String _description;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Description^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
        [DisplayName("Description")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Description^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^")]
        [DataObjectField(false, false, false, 100)]
        [BindColumn(5, "description",  null, "varchar(100)", 0, 0, false)]

        public virtual String description

        {
            get { return _description; }
            set { if (OnPropertyChanging(__.description, value)) { _description = value; OnPropertyChanged(__.description); } }
        }

 
        private String _note_text;

        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
        [DisplayName("备注")]
        [Description("FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^")]
        [DataObjectField(false, false, true, 2000)]
        [BindColumn(6, "note_text",  null, "varchar(2000)", 0, 0, false)]

        public virtual String note_text

        {
            get { return _note_text; }
            set { if (OnPropertyChanging(__.note_text, value)) { _note_text = value; OnPropertyChanged(__.note_text); } }
        }


        private String _objid;

        /// <summary></summary>
        [DisplayName("Objid")]
        [Description("")]
        [DataObjectField(true, false, false, 50)]
        [BindColumn(15, "rowid", null, "varchar(50)", 0, 0, false)]

        public virtual String rowid
        {
            get { return _objid; }
            set { if (OnPropertyChanging(__.objid, value)) { _objid = value; OnPropertyChanged(__.objid); } }
        }


        //private DateTime? _objversion;

        ///// <summary></summary>
        //[DisplayName("rowversion")]
        //[Description("")]
        //[DataObjectField(false, false, true, 24)]
        //[BindColumn(16, "rowversion", null, "varchar(24)", 0, 0, false)]

        //public virtual DateTime? rowversion
        //{
        //    get { return _objversion; }
        //    set { if (OnPropertyChanging(__.objversion, value)) { _objversion = value; OnPropertyChanged(__.objversion); } }
        //}
        #endregion

        #region 获取/设置 字段值
        /// <summary>
        /// 获取/设置 字段值。
        /// 一个索引，基类使用反射实现。
        /// 派生实体类可重写该索引，以避免反射带来的性能损耗
        /// </summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        public override Object this[String name]
        {
            get
            {
                switch (name)
                {
                    case __.lu_name : return _lu_name;
                    case __.db_value : return _db_value;
                    case __.client_value : return _client_value;
                    case __.module : return _module;
                    case __.description : return _description;
                    case __.note_text : return _note_text;
                    case __.objid : return _objid;
                  //  case __.objversion : return _objversion;
                    default: return base[name];
                }
            }
            set
            {
                switch (name)
                {
                    case __.lu_name : 
                        if(value != null)
                            _lu_name = Convert.ToString(value);
                        else
                            _lu_name = null;
                    break;
                    case __.db_value : 
                        if(value != null)
                            _db_value = Convert.ToString(value);
                        else
                            _db_value = null;
                    break;
                    case __.client_value : 
                        if(value != null)
                            _client_value = Convert.ToString(value);
                        else
                            _client_value = null;
                    break;
                    case __.module : 
                        if(value != null)
                            _module = Convert.ToString(value);
                        else
                            _module = null;
                    break;
                    case __.description : 
                        if(value != null)
                            _description = Convert.ToString(value);
                        else
                            _description = null;
                    break;
                    case __.note_text : 
                        if(value != null)
                            _note_text = Convert.ToString(value);
                        else
                            _note_text = null;
                    break;
                    case __.objid : 
                        if(value != null)
                            _objid = Convert.ToString(value);
                        else
                            _objid = null;
                    break;
                    //case __.objversion:
                    //if (value != null)
                    //    _objversion = Convert.ToDateTime(value);
                    //else
                    //    _objversion = null;
                    break;
                    default: base[name] = value; break;
                }
            }
        }
        #endregion

        #region 字段名
        /// <summary>取得字段信息的快捷方式</summary>
        public class _
        {
            ///<summary>FLAGS=KMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Lu Name^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=False^ARG=^</summary>
            public static readonly Field lu_name = FindByName(__.lu_name);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Db Value^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public static readonly Field db_value = FindByName(__.db_value);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=显示值^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public static readonly Field client_value = FindByName(__.client_value);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Module^LENGTH=15^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public static readonly Field module = FindByName(__.module);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Description^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public static readonly Field description = FindByName(__.description);

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public static readonly Field note_text = FindByName(__.note_text);

            ///<summary></summary>
            public static readonly Field objid = FindByName(__.objid);

            ///<summary></summary>
            public static readonly Field objversion = FindByName(__.objversion);

            static Field FindByName(String name) { return Meta.Table.FindByName(name); }
        }

        /// <summary>取得字段名称的快捷方式</summary>
        class __
        {
            ///<summary>FLAGS=KMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Lu Name^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=False^ARG=^</summary>
            public const String lu_name = "lu_name";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Db Value^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public const String db_value = "db_value";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=显示值^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public const String client_value = "client_value";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Module^LENGTH=15^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public const String module = "module";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Description^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public const String description = "description";

            ///<summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>
            public const String note_text = "note_text";

            ///<summary></summary>
            public const String objid = "rowid";

            ///<summary></summary>
            public const String objversion = "rowversion";

        }
        #endregion
    }

    /// <summary>接口</summary>
    public partial interface Ifnd_enumerate
    {
       #region 属性
        /// <summary>FLAGS=KMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Lu Name^LENGTH=35^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=False^ARG=^</summary>

        String lu_name { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Db Value^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>

        String db_value { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=显示值^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>

        String client_value { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Module^LENGTH=15^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>

        String module { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=Description^LENGTH=100^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>

        String description { get; set; }


        /// <summary>FLAGS=AMIUL^FORMAT=Unformatted^DATATYPE=String^PROMPT=备注^LENGTH=2000^KEYS=^REF=^VIEW=^OPTION=^PUBLIC=True^ARG=^</summary>

        String note_text { get; set; }

        /// <summary></summary>

        String rowid { get; set; }


        /// <summary></summary>

       // DateTime? rowversion { get; set; }

        #endregion

        #region 获取/设置 字段值
        /// <summary>获取/设置 字段值。</summary>
        /// <param name="name">字段名</param>
        /// <returns></returns>
        Object this[String name] { get; set; }
        #endregion
    }
}